<%@page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()	+ path + "/";%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>   
    <base href="<%=basePath%>"/>
    <title>广元电业局低质易耗品管理平台</title>
	<link rel="stylesheet" rev="stylesheet" href="css/style.css" type="text/css" media="all" />
    <link rel="stylesheet" type="text/css" href="css/main.css"/>
	<script type="text/javascript" src="${pageContext.request.contextPath}/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/addDeclaration.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/Pinyin.js"></script>
    <script language="javascript">
        function select(obj,targetValue)
          {
             var id=parseInt(obj.value);
             document.getElementById("othermMchntName").value=obj.options[obj.selectedIndex].text;
             if(obj.value!=targetValue){
                   document.getElementById("othermMchntName").readOnly=true;
              }else{
                   document.getElementById("othermMchntName").readOnly=false;
                   document.getElementById("othermMchntName").value = "" ;
                   document.getElementById("othermMchntName").focus();
             }
             
         }
		function showCategory(){
			var vRValue = window.showModalDialog("CategoryTree.jsp",null,"dialogWidth=320px;dialogHeight=450px;status=0;scroll=0");
		  	if(vRValue == undefined){
		  	  	vRValue = '';
		  	}
			var catid = (vRValue=='')?'':vRValue.split(',')[0];
			var catname = (vRValue=='')?'':vRValue.split(',')[1];
			if(catid != undefined && catname != undefined){
				document.getElementById("selectCategory").value = catid;
				document.getElementById("category").value = catname;
			}
		}
		//得到资产名的简称  每个汉字的首字母
		  function getOthername(){
			    var acname = document.getElementById("acid").value;
			    var name = CC2PY(acname);
			    document.getElementById("othername").value = '';
			    for(var i=0;i<name.length;i++){
					if(name.charAt(i)>'A' && name.charAt(i)<'Z')
					{   
					 document.getElementById("othername").value+=name.charAt(i);
				    }
			       }  
			  }
	</script>

</head>

<body class="ContentBody">
<form action="readInInfoSurplus.action" method="post" onsubmit="return validateAll();">
<div class="MainDiv">
	<table width="99%" border="0" cellpadding="0" cellspacing="0" class="CContent">
		  <tr>
		      <th class="tablestyle_title" >资产申报信息录入</th>
		  </tr>
		  <tr>
		    <td class="CPanel">
				<table border="0" cellpadding="0" cellspacing="0" style="width:100%">
				<tr>		
				   <td width="100%">
					  <fieldset style="height:100%;">
						<legend>资产申报信息</legend>	
							<input type="hidden" value="0" id="assetCardId" name="assetCard.acid"/>	
							<input type="hidden" value="N" name="assetCard.ispublic"/>	      
							<table border="0" cellpadding="2" cellspacing="1" style="width:100%">	
								<tr>									  
								  <td align="right">资产名称:</td>
								     <td>
								     	<input type="text" name="assetCard.acname" style="width:154px;" onkeyup="getOthername()"
								     	 id="acid"/>
			                            <span style="color: red">*</span>
			                        </td>
								   <td align="right">资产简称:</td>
								   <td ><input name="assetCard.acanothername" id="othername"  type="text" class="text" style="width:154px"/></td> 
								 </tr>		    
								 <tr>
								   <td align="right">资产类别:</td>
								   <td>
								    <s:hidden id="selectCategory"  name="catid"/>
								    <input type="text" id="category" readonly="true" style="width:154px"/>
							  		<img src="images/showDep.gif" onclick="showCategory()" style="cursor: pointer;" alt="选择资产类别" title="选择资产类别" />
								   </td>
								                
								   <td align="right">资产数量:</td>
								   <td><input class="text" name="assetCard.count" style="width:154px" id="quantity"/>
								       <span style="color:red">*</span>
								   </td>  
								 </tr>
								  <tr> 
								   <td align="right">生产厂家:</td>
								    <td><input class="text" name="assetCard.producer" style="width:154px" value=""/></td> 
								  <td align="right">单&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;价:</td>
								    <td><input class="text" name="assetCard.reportprice" style="width:154px" value=""/></td>				    
								  </tr> 					  		  
								  <tr> 
								    <td align="right">资金来源:</td>
								    <td>
								 	<span style="margin-left:100px;width:18px;overflow:hidden;" >
                                     <select name="mchntName" id="mchntName" style="width:118px;margin-left:-100px" onchange="select(this,'0')">
                                           <s:iterator value="comefromList" var="sa">
	                                   	       <option><s:property value="#sa.come_desc"/></option>
	                                       </s:iterator>
                                               <option value="0" selected="selected">其他</option>
                                    </select>
                                    </span>
                                     <input name="assetCard.assetcomefrom" id="othermMchntName" style="width:100px;left:10px" readonly="readonly" />
								 
								    </td>
								 	<td align="right">预计停用日期:</td>
								    <td><input class="text" name="assetCard.planstopdate" id="planstopdate" style="width:154px" value="" onclick="WdatePicker()"/></td>	    				      
								  </tr>       
								  <tr>	
								   	<td align="right">生产日期:</td>
								    <td><input class="text" name="assetCard.producedate" id="producedate" style="width:154px" value=""  onclick="WdatePicker()"/></td>	    				   
								   <td align="right">使用期限:</td>
								    <td><input class="text" name="assetCard.lifetime" style="width:154px" value=""/></td>				    
								  </tr>      
								  <tr>
								   <td align="right">申请部门:</td>
								    <td>
								     <select name="assetCard.reportdepartment" style="width:158px" id="reportdepartment">
                                       <option selected="selected" value=''>==请选择==</option>
                                          <s:iterator value="departments">
                                            <s:if test="depid!=0">
                                                 <option value="<s:property value='depname'/>"><s:property value="depname"/></option>
                                            </s:if>
                                          </s:iterator> 
                                    </select>
								    </td>				
								  </tr>      
								  <tr>	
								    <td align="right">申报原因:</td>
					                <td colspan="3"><textarea name="assetCard.reportreason" cols="100" rows="8" ></textarea></td>
								  </tr>
						</table>
							  <br />
						</fieldset>
					</td>
				</tr>
				</table>	
		 	</td>
		</tr>			
		<tr>
			<td colspan="2" align="center" height="50px">
			<input type="hidden" name="FN" value="<s:property value='FN'/>" />
			<input type="submit" name="Submit" value="保存" />　
			<input type="button" name="Submit2" value="返回" onclick="window.history.go(-1);"/>
			</td>
		</tr> 
	</table>
</div>
</form>
</body>
</html>

